﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GeneralTheGame
{
    class Program
    {
        static void Main(string[] args)
        {
            // Testing the player name
            string playerName = Console.ReadLine();
            Player firstPlayer = new Player(playerName, ConsoleColor.Cyan);
            Console.WriteLine(firstPlayer.PlayerName);

            // Testing the player combinations
            // First test the default status;
            Console.WriteLine(firstPlayer.PlayerCombinations[8]);
            
            // After that use SetPlayerCombination to se the Ones score to 25 and set the Ones flag to true
            firstPlayer.SetPlayerCombination(8, 25);
            Console.WriteLine(firstPlayer.PlayerCombinations[8]);
            Console.WriteLine(firstPlayer.TotalPlayerScore);

            // Test default dice rolls
            // First the the dice values at initialisation
            for (int i = 0; i < firstPlayer.PlayerDice.Count; i++)
            {
                Console.WriteLine(firstPlayer.PlayerDice[i].GetLastThrow());
            }

            Console.WriteLine();

            // Then roll all dice and check their current values
            firstPlayer.RollAllDice();

            for (int i = 1; i <= firstPlayer.PlayerDice.Count; i++)
            {
                Console.WriteLine(firstPlayer.GetLastDieThrow(i));
            }

            Console.WriteLine();

            // After that roll only dice 1, 3 and 5 and check the new values
            List<int> diceNumbers = new List<int>() { 1, 3, 5 };
            firstPlayer.ThrowDice(diceNumbers);

            for (int i = 1; i <= firstPlayer.PlayerDice.Count; i++)
            {
                Console.WriteLine(firstPlayer.GetLastDieThrow(i));
            }

            Console.WriteLine();

            Console.WriteLine(firstPlayer.CheckTemporaryScore());

            firstPlayer.SetPlayerCombination(0, 0);
            firstPlayer.SetPlayerCombination(1, -5);
            firstPlayer.SetPlayerCombination(2, -5);
            firstPlayer.SetPlayerCombination(3, -10);
            firstPlayer.SetPlayerCombination(4, 10);
            firstPlayer.SetPlayerCombination(5, -10);

            firstPlayer.SetPlayerCombination(10, 10);

            Console.WriteLine(firstPlayer.TotalPlayerScore);

            Console.WriteLine(firstPlayer.CheckTemporaryScore());

            Console.WriteLine(firstPlayer.TemporaryPlayerScore);

        }
    }
}
